<template>
    <div id="doctortype">
        <header>
            <i @click="goBack()"></i>
            <div>我的级别</div>
            <router-link :to='{name: "doctorvipAuth1",query: {}}'>续费</router-link>
        </header>
        <div class='border10'></div>
        <ul class='content'>
            <li>
                <div>
                    <div><h1>{{doctorObj.grade || '暂无充值'}}</h1></div>
                    <h4>剩余 {{doctorObj.remaining || '0分钟'}}</h4>
                </div>
            </li>
        </ul>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                doctorid: localStorage.getItem("loginMobile"),
                doctorObj: {},
            }
        },
        filters: {
            // 把数字转换成日期
            toNum(time) {
                const str = parseInt(time);
                return str;
            },
        },
        methods: {
            //返回上一级
            goBack() {
                // this.$router.push({name: 'doctorAuth'});
                this.$router.back();
            },
            // 获取医生等级及余额
            getDocGrade() {
                this.$api.get(this.$api.baseURLSchool,"select_cid/doctor/"+this.doctorid,{},r => {
                        if(r.data.ret == 1) {
                            this.doctorObj = r.data.info;
                        }
                        
                    },err => {
                        console.log(err);
                    })
            },
        },
        created() {
            this.getDocGrade();
        }
    }

</script>
<style lang="scss" scoped>
    h4 {
        padding-top: 7px;
    }
</style>